<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>png++: png::writer&lt; ostream &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">png++
   &#160;<span id="projectnumber">0.2.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacepng.html">png</a>      </li>
      <li class="navelem"><a class="el" href="classpng_1_1writer.html">writer</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">png::writer&lt; ostream &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="png::writer" --><!-- doxytag: inherits="png::io_base" -->
<p>PNG writer class template. This is the low-level writing interface--use image class or generator class to actually write images.  
 <a href="classpng_1_1writer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="writer_8hpp_source.html">writer.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for png::writer&lt; ostream &gt;:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classpng_1_1writer.png" usemap="#png::writer&lt; ostream &gt;_map" alt=""/>
  <map id="png::writer&lt; ostream &gt;_map" name="png::writer&lt; ostream &gt;_map">
<area href="classpng_1_1io__base.html" title="Base class for PNG reader/writer classes." alt="png::io_base" shape="rect" coords="0,0,139,24"/>
</map>
 </div></div>

<p><a href="classpng_1_1writer-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpng_1_1writer.html#a4f29f0237affe2660f068851403ca468">writer</a> (ostream &amp;stream)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a writer prepared to write PNG image into a <em>stream</em>.  <a href="#a4f29f0237affe2660f068851403ca468"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpng_1_1writer.html#a75ec970309438fd2cf5166fe259de36e">~writer</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpng_1_1writer.html#a9804465c1d54eec114a38e3d29a4481d">write_png</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpng_1_1writer.html#a36bc62c0fe6d99dcec439fde2d54228c">write_info</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write info about PNG image.  <a href="#a36bc62c0fe6d99dcec439fde2d54228c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpng_1_1writer.html#aa88beb256941e06e54e6842a1b0a81ee">write_row</a> (<a class="el" href="namespacepng.html#ac0e0e2e09bdd9a287618bfdc5f31ca52">byte</a> *bytes)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a row of image data at a time.  <a href="#aa88beb256941e06e54e6842a1b0a81ee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpng_1_1writer.html#a935ff64a683bb7d98961ff936976f52c">write_end_info</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads ending info about PNG image.  <a href="#a935ff64a683bb7d98961ff936976f52c"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;class ostream&gt;<br/>
class png::writer&lt; ostream &gt;</h3>

<p>PNG writer class template. This is the low-level writing interface--use image class or generator class to actually write images. </p>
<p>The <code>ostream</code> template parameter specifies the type of output stream to work with. The <code>ostream</code> class should implement the minimum of the following interface:</p>
<div class="fragment"><pre class="fragment"> <span class="keyword">class </span>my_ostream
 {
 <span class="keyword">public</span>:
     <span class="keywordtype">void</span> write(<span class="keywordtype">char</span> <span class="keyword">const</span>*, <span class="keywordtype">size_t</span>);
     <span class="keywordtype">void</span> flush();
     <span class="keywordtype">bool</span> good();
 };
</pre></div><p>With the semantics similar to the <code>std::ostream</code>. Naturally, <code>std::ostream</code> fits this requirement and can be used with the writer class as is.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classpng_1_1image.html" title="Class template to represent PNG image.">image</a>, <a class="el" href="classpng_1_1reader.html" title="The PNG reader class template. This is the low-level reading interface--use image class or consumer c...">reader</a>, <a class="el" href="classpng_1_1generator.html" title="Pixel generator class template.">generator</a>, <a class="el" href="classpng_1_1io__base.html" title="Base class for PNG reader/writer classes.">io_base</a> </dd></dl>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a4f29f0237affe2660f068851403ca468"></a><!-- doxytag: member="png::writer::writer" ref="a4f29f0237affe2660f068851403ca468" args="(ostream &amp;stream)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ostream&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classpng_1_1writer.html">png::writer</a>&lt; ostream &gt;::<a class="el" href="classpng_1_1writer.html">writer</a> </td>
          <td>(</td>
          <td class="paramtype">ostream &amp;&#160;</td>
          <td class="paramname"><em>stream</em></td><td>)</td>
          <td><code> [inline, explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructs a writer prepared to write PNG image into a <em>stream</em>. </p>

<p>References <a class="el" href="classpng_1_1io__base.html#a343eb5ab2ad984e7020d8489b64ec9d2">png::io_base::m_png</a>.</p>

</div>
</div>
<a class="anchor" id="a75ec970309438fd2cf5166fe259de36e"></a><!-- doxytag: member="png::writer::~writer" ref="a75ec970309438fd2cf5166fe259de36e" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ostream&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classpng_1_1writer.html">png::writer</a>&lt; ostream &gt;::~<a class="el" href="classpng_1_1writer.html">writer</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>References <a class="el" href="classpng_1_1end__info.html#a40da9911dddbf4ec026aa8480800a755">png::end_info::destroy()</a>, <a class="el" href="classpng_1_1info__base.html#afe70c0d333349a9b5fc7a1d046fc3fbc">png::info_base::get_png_info_ptr()</a>, <a class="el" href="classpng_1_1io__base.html#a4dc235d3aa8764d1a1a73c6d1fefed61">png::io_base::m_end_info</a>, <a class="el" href="classpng_1_1io__base.html#a3253298a348305da3f3b6cf38f201300">png::io_base::m_info</a>, and <a class="el" href="classpng_1_1io__base.html#a343eb5ab2ad984e7020d8489b64ec9d2">png::io_base::m_png</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a9804465c1d54eec114a38e3d29a4481d"></a><!-- doxytag: member="png::writer::write_png" ref="a9804465c1d54eec114a38e3d29a4481d" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ostream&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpng_1_1writer.html">png::writer</a>&lt; ostream &gt;::<a class="el" href="classpng_1_1writer.html#a9804465c1d54eec114a38e3d29a4481d">write_png</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>References <a class="el" href="classpng_1_1info__base.html#a030a8262a2ef1bf8c97a2eafe71c2f3c">png::info_base::get_png_info()</a>, <a class="el" href="classpng_1_1io__base.html#a0525d690575be17366b555672bac823e">png::io_base::m_error</a>, <a class="el" href="classpng_1_1io__base.html#a3253298a348305da3f3b6cf38f201300">png::io_base::m_info</a>, and <a class="el" href="classpng_1_1io__base.html#a343eb5ab2ad984e7020d8489b64ec9d2">png::io_base::m_png</a>.</p>

</div>
</div>
<a class="anchor" id="a36bc62c0fe6d99dcec439fde2d54228c"></a><!-- doxytag: member="png::writer::write_info" ref="a36bc62c0fe6d99dcec439fde2d54228c" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ostream&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpng_1_1writer.html">png::writer</a>&lt; ostream &gt;::<a class="el" href="classpng_1_1writer.html#a36bc62c0fe6d99dcec439fde2d54228c">write_info</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write info about PNG image. </p>

<p>References <a class="el" href="classpng_1_1io__base.html#a0525d690575be17366b555672bac823e">png::io_base::m_error</a>, <a class="el" href="classpng_1_1io__base.html#a3253298a348305da3f3b6cf38f201300">png::io_base::m_info</a>, <a class="el" href="classpng_1_1io__base.html#a343eb5ab2ad984e7020d8489b64ec9d2">png::io_base::m_png</a>, and <a class="el" href="classpng_1_1info.html#a863333fbef670b244920022d1a0ee210">png::info::write()</a>.</p>

<p>Referenced by <a class="el" href="classpng_1_1generator.html#ab96a8e8e7050afddb307141d7cabb5eb">png::generator&lt; pixel, pixel_generator, image_info_ref_holder, true &gt;::write()</a>.</p>

</div>
</div>
<a class="anchor" id="aa88beb256941e06e54e6842a1b0a81ee"></a><!-- doxytag: member="png::writer::write_row" ref="aa88beb256941e06e54e6842a1b0a81ee" args="(byte *bytes)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ostream&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpng_1_1writer.html">png::writer</a>&lt; ostream &gt;::<a class="el" href="classpng_1_1writer.html#aa88beb256941e06e54e6842a1b0a81ee">write_row</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespacepng.html#ac0e0e2e09bdd9a287618bfdc5f31ca52">byte</a> *&#160;</td>
          <td class="paramname"><em>bytes</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Writes a row of image data at a time. </p>

<p>References <a class="el" href="classpng_1_1io__base.html#a0525d690575be17366b555672bac823e">png::io_base::m_error</a>, and <a class="el" href="classpng_1_1io__base.html#a343eb5ab2ad984e7020d8489b64ec9d2">png::io_base::m_png</a>.</p>

<p>Referenced by <a class="el" href="classpng_1_1generator.html#ab96a8e8e7050afddb307141d7cabb5eb">png::generator&lt; pixel, pixel_generator, image_info_ref_holder, true &gt;::write()</a>.</p>

</div>
</div>
<a class="anchor" id="a935ff64a683bb7d98961ff936976f52c"></a><!-- doxytag: member="png::writer::write_end_info" ref="a935ff64a683bb7d98961ff936976f52c" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class ostream&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpng_1_1writer.html">png::writer</a>&lt; ostream &gt;::<a class="el" href="classpng_1_1writer.html#a935ff64a683bb7d98961ff936976f52c">write_end_info</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reads ending info about PNG image. </p>

<p>References <a class="el" href="classpng_1_1io__base.html#a4dc235d3aa8764d1a1a73c6d1fefed61">png::io_base::m_end_info</a>, <a class="el" href="classpng_1_1io__base.html#a0525d690575be17366b555672bac823e">png::io_base::m_error</a>, <a class="el" href="classpng_1_1io__base.html#a343eb5ab2ad984e7020d8489b64ec9d2">png::io_base::m_png</a>, and <a class="el" href="classpng_1_1end__info.html#af3974f800aa7987beef61667313ab3ad">png::end_info::write()</a>.</p>

<p>Referenced by <a class="el" href="classpng_1_1generator.html#ab96a8e8e7050afddb307141d7cabb5eb">png::generator&lt; pixel, pixel_generator, image_info_ref_holder, true &gt;::write()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="writer_8hpp_source.html">writer.hpp</a></li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Fri Jan 25 2013 14:10:10 for png++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
